package ReaderAndWriter;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class InputStreamReaderDemo {
    public static void main(String[] args) throws IOException {
        InputStreamReader isr = new InputStreamReader(new FileInputStream("funCode\\fos.txt"));


        int ch;
        while ((ch = isr.read()) != -1) {

            System.out.println((char)ch);
        }

        char[] chars = new char[1024];
        int len;
        while ((len = isr.read(chars)) != -1) {
            System.out.println(new String(chars,0,len));
        }
        // release
        isr.close();
    }
}
